﻿using System.Linq;
using Nxg.Blog.Core.Documents;

namespace Nxg.Blog.Core.ViewProjections.Account {
    public class GetUserDetails : IViewProjection<int, Author> {
        private readonly DataContext _db;

        public GetUserDetails (DataContext db) {
            _db = db;
        }

        public Author Project (int input) {
            return _db.Author.SingleOrDefault (x => x.Id == input);
        }
    }
}